<?php 
	namespace app\data\model;

	use think\Model;

	/**
	* 属性模型
	*/
	class ShopAttr extends Model
	{
		/**
		 * 关联模型
		 * @return [type] [description]
		 */
		public function attr()
		{
			return $this->belongsTo('ShopCates','id');
		}

		/**
		 * 获取所有模型属性
		 * @param  [type] $model_id [模型id]
		 * @return [type]           [description]
		 */
		public function all_model_attr($model_id)
		{
			return $this->where('model_id',$model_id)->order('sort','desc')->order('id','asc')->select();
		}
	}